package domain;

import static org.junit.Assert.*;

import java.util.Date;

import org.jfree.data.time.Day;
import org.junit.BeforeClass;
import org.junit.Test;

//Denne Test case er til version 1.2
//@Author: Andy Vidkjaer


public class Test12 {
	
	static Service service = Service.getInstance();
	
	@BeforeClass
	public static void beforeClass(){
		service.createSomeObjects();
	}
	
	@Test
	public void getFilteredMellemVareTest(){
		assertTrue(service.getfilteredMellemvarer(true, false).get(0).getLagerplads() != null);
	}
	
	@Test
	public void getVarerMedTilstandTest(){
		assertTrue(service.getVarerMedTilstand(Tilstand.TOERRING).get(0).getTilstand() == Tilstand.TOERRING);
	}
	
	@Test
	public void getNotificationAntal(){
		assertTrue(service.getNotificationAntal()[1] == 51);
	}
	
	@Test 
	public void getChartDataTest2(){
		assertTrue(service.getChartdata().getValue(new Day(new Date(2011-1900, 4, 10))).intValue() == 1);
	}
	
	@Test
	public void getNaestePlukTest(){
		assertTrue(service.findMellemvare(service.getNaestePluk()).getLagerplads() != null);
	}

}
